package com.study.demoservice.controller;

import com.study.demoservice.bean.Student;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class StudentController {

    private List<Student> studentList;

    public StudentController(List<Student> studentList) {
        this.studentList = studentList;
    }

    @RequestMapping(path = "students", method = RequestMethod.GET)
    public String listStudents() {
        return studentList.toString();
    }
}
